import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()) { 
            int n = in.nextInt();
            long[] arr = new long[n*3];
            for(int i = 0; i < n*3 ; i++){
                arr[i] = in.nextLong();
            }
            Arrays.sort(arr);
            long sum = 0;
            for(int j = 1; j <= n ; j++){
                sum += arr[arr.length - (j*2)];
            }
            System.out.print(sum);
        }
    }
}